using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Diagnostics;
using System.Text.RegularExpressions;

namespace NeuroSpeech.Imap
{
	public class ImapRequestMessagePart : UIDImapRequest<ImapResponseMessagePart>
	{

		public ImapMimePart Part { get; set; }

		public ulong Id { get; set; }

		#region public override string  ToString()
		public override string ToString()
		{
			string bodyPart = Part.PartIndex;
			if (string.IsNullOrWhiteSpace(bodyPart))
			{
				bodyPart = "TEXT";
			}
			else {
				//bodyPart += ".TEXT";
			}
			return string.Format("FETCH {0} BODY.PEEK[{1}]", Id, bodyPart);
		}
		#endregion


		#region protected override void  PostProcess(ImapClient client, ImapResponseMessagePart response)
		protected override void PostProcess(ImapClient client, ImapResponseMessagePart response)
		{
			base.PostProcess(client, response);

			response.Part = this.Part;

			
		}
		#endregion


	}
}
